package com.example.financechain.service;

import com.example.financechain.Utils.JsonData;
import com.example.financechain.domain.DTO.AuditParam;
import com.example.financechain.domain.entity.Financing;
import com.baomidou.mybatisplus.extension.service.IService;
import org.hyperledger.fabric.gateway.ContractException;

import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.cert.CertificateException;
import java.util.concurrent.TimeoutException;

/**
 * <p>
 * 融资信息表 服务类
 * </p>
 *
 * @author yy
 * @since 2023-04-19
 */
public interface IFinancingService extends IService<Financing> {


    /**
     * 创建融资项目 并且资质审核
     * @param financing
     * @return
     */
    JsonData createfiance(Financing financing);


    /**
     * 资料完善
     * @param financing
     * @return
     */
    JsonData Completeinformation(Financing financing);

    /**
     * 银行审查界面
     * @return
     */
    JsonData queryfinance();

    /**
     * 根据id查询
     * @return
     */
    JsonData queryfinancebyId(Long id);


    /**
     * 审核结果
     * @param auditParam
     * @return
     */
    JsonData auditResult(AuditParam auditParam);

    /**
     * 企业创建融资项目的时候判断有没有融资id
     * @return
     */
    JsonData queryfinancingexsit();

    /**
     * 银行签约
     * @param financing
     * @return
     */
    JsonData contracting(Financing financing);

    /**
     * 企业接受签约
     * @param financing
     * @return
     * @throws CertificateException
     * @throws IOException
     * @throws InvalidKeyException
     * @throws ContractException
     * @throws InterruptedException
     * @throws TimeoutException
     */
    JsonData acceptContrac(Financing financing) throws CertificateException, IOException, InvalidKeyException, ContractException, InterruptedException, TimeoutException;

    /**
     * 查询跟自己有关的所有融资
     * @return
     */
    JsonData querymessage();
}
